package com.latam.arq.example.events.listeners;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.latam.arq.commons.events.annotations.BusinessEventListener;
import com.latam.arq.commons.events.beans.BusinessEvent;
import com.latam.arq.commons.events.listeners.IBusinessEventListener;
import com.latam.arq.commons.events.mappers.IBusinessEventMapper;

@BusinessEventListener(eventNames="HelloEvent")
public class HelloEventManager implements IBusinessEventListener{
	private static final Logger logger = LoggerFactory.getLogger(HelloEventManager.class);
	
	@Override
	public void process(BusinessEvent businessEvent, IBusinessEventMapper mapper ) {
		if (logger.isInfoEnabled()){
			logger.info("Processing a Hello Event inside the Business Layer.");
			logger.info("body: " + businessEvent.getBody() );
		}
	}

}
